package PTA_JAVA.JavaBase.JavaBase08;

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt(),b=(a+1)%7+1;
        System.out.print(b);
    }
}
